import { Base64 } from "./base64";
// 封装方法，通过token解密获得用户id
function getUserId(token){
    const base=new Base64()
    let last=token.lastIndexOf('.')
    let token2=token.slice(0,last)
    let head=token.indexOf('.')
    let token3=token2.slice(head+1)
    let str=base.decode(token3)
    let y=str.indexOf('}')
    str=str.slice(0,y+1)
    let object=eval("(" + str + ")")
    // console.log(object);
    return object.aud
}

export{
    getUserId
}